package com.gitee.itembucket.core.storage

import com.gitee.itembucket.core.bucket.Bucket
import com.gitee.itembucket.core.bucket.ItemOperationLog
import org.bukkit.OfflinePlayer
import java.util.concurrent.CompletableFuture

interface Storage {

    companion object {

        val INSTANCE : Storage by lazy { StorageSQL() }

    }

    fun getBucket(player: OfflinePlayer): Bucket

    fun createItem(player: OfflinePlayer, item: Bucket.Item): CompletableFuture<Void>

    fun updateItem(player: OfflinePlayer, item: Bucket.Item)

    fun removeItem(player: OfflinePlayer,item: Bucket.Item)

    fun addItemLog(log: ItemOperationLog)

    fun getItemLogs(player: OfflinePlayer): List<ItemOperationLog>

}